package persentation.presentStudent;

import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;

import vo.courseVO.CourseVO;

public class InfoPanel extends JPanel {

	private CourseVO courseVO;
	private static Image INFO=new ImageIcon("Graphics/studentGraphics/info.png").getImage();
	
	public InfoPanel(CourseVO courseVO) {
		setSize(800, 643);
		setLayout(null);
		this.courseVO=courseVO;
		
		JLabel label = new JLabel("课程编号:\r\n");
		label.setFont(new Font("微软雅黑", Font.BOLD, 16));
		label.setBounds(92, 10, 70, 27);
		add(label);
		
		JLabel label_1 = new JLabel(courseVO.getCourseId());
		label_1.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_1.setBounds(209, 16, 199, 15);
		add(label_1);
		
		JLabel label_2 = new JLabel("课程名：");
		label_2.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_2.setBounds(92, 58, 100, 15);
		add(label_2);
		
		JLabel lblNewLabel = new JLabel(courseVO.getCourseName());
		lblNewLabel.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		lblNewLabel.setBounds(209, 58, 199, 15);
		add(lblNewLabel);
		
		JLabel label_3 = new JLabel("课程性质：");
		label_3.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_3.setBounds(430, 13, 87, 21);
		add(label_3);
		
		JLabel label_4 = new JLabel(courseVO.getAttribute());
		label_4.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_4.setBounds(556, 16, 150, 15);
		add(label_4);
		
		JLabel label_5 = new JLabel("任课老师：");
		label_5.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_5.setBounds(92, 108, 87, 15);
		add(label_5);
		
		JLabel lblNewLabel_1 = new JLabel(courseVO.getTeacherName());
		lblNewLabel_1.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		lblNewLabel_1.setBounds(209, 108, 189, 15);
		add(lblNewLabel_1);
		
		JLabel label_6 = new JLabel("上课时间：");
		label_6.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_6.setBounds(430, 58, 81, 27);
		add(label_6);
		
		JLabel label_7 = new JLabel(courseVO.getCourseTime());
		label_7.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_7.setBounds(556, 58, 189, 15);
		add(label_7);
		
		JLabel label_8 = new JLabel("学分：");
		label_8.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_8.setBounds(92, 154, 54, 15);
		add(label_8);
		
		JLabel lblNewLabel_2 = new JLabel(courseVO.getCredit()+"");
		lblNewLabel_2.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		lblNewLabel_2.setBounds(221, 154, 81, 15);
		add(lblNewLabel_2);
		
		JLabel label_9 = new JLabel("课时：");
		label_9.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_9.setBounds(430, 154, 54, 15);
		add(label_9);
		
		JLabel lblNewLabel_3 = new JLabel(courseVO.getCoursePeriod()+"");
		lblNewLabel_3.setFont(new Font("宋体", Font.PLAIN, 16));
		lblNewLabel_3.setBounds(583, 154, 54, 15);
		add(lblNewLabel_3);
		
		JLabel label_10 = new JLabel("教室：");
		label_10.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_10.setBounds(430, 108, 54, 15);
		add(label_10);
		
		JLabel label_11 = new JLabel(courseVO.getClassroom());
		label_11.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_11.setBounds(556, 108, 176, 15);
		add(label_11);
		
		JLabel label_12 = new JLabel("助教信息：");
		label_12.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_12.setBounds(81, 238, 87, 15);
		add(label_12);
		
		JLabel label_13 = new JLabel("课程简介：");
		label_13.setFont(new Font("微软雅黑", Font.PLAIN, 18));
		label_13.setBounds(81, 325, 111, 15);
		add(label_13);
		
		JTextArea textArea = new JTextArea();
		textArea.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		textArea.setBounds(227, 296, 541, 77);
		add(textArea);
		textArea.setText(courseVO.getIntroduction());
		textArea.setEditable(false);
		
		JLabel label_14 = new JLabel("推荐书目：");
		label_14.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		label_14.setBounds(81, 457, 111, 15);
		add(label_14);
		
		JTextArea textArea_1 = new JTextArea();
		textArea_1.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		textArea_1.setBounds(221, 423, 541, 83);
		add(textArea_1);
		textArea_1.setText(courseVO.getBook());
		textArea_1.setEditable(false);
		
		JTextArea textArea_2 = new JTextArea();
		textArea_2.setFont(new Font("微软雅黑", Font.PLAIN, 16));
		textArea_2.setBounds(227, 232, 541, 40);
		add(textArea_2);
		textArea_2.setText(courseVO.getAssistant());
		textArea_2.setEditable(false);
	
	}
	
	public void paintComponent(Graphics g){
		g.drawImage(INFO, 0,0, null);
	}
}
